Although males and females of a species share the same genome more or less, they exhibit different adaptive optima for many traits. The resulting sexually antagonistic selection and sexual conflict lead to the evolution of sexually dimorphic phenotypes at both organismal and molecular levels. The Y chromosome in Diptera (e.g., flies and mosquitoes) and W chromosome in Lepidoptera (butterflies and moths) only occur in males and females, respectively, creating a potential reservoir for genetic elements that would exert unequal functional and fitness effects in the two sexes. However, due to the highly repetitive, heterochromatic nature of these chromosomes, their structure and function have been recalcitrant to scrutiny. Using comparative genomics, functional genomics, and genome editing, our lab investigates the roles repetitive sequences play in sexual dimorphism and sexual conflict in insects and butterflies.