Ron Swanstrom has studied HIV since 1986 with a special interest in using viral sequence variation as a tool to identify a changing selective environment. This approach is especially relevant for the study of the viral env gene, since its protein product is the target of host neutralizing antibodies and the determinant of viral entry phenotype.The high diversity and phenotypic variation of this region of the viral genome has made it a useful target of sequencing studies to look at the transmitted virus, and in examining determinants of compartmentalization in the male and female genital tract and in the CNS/CSF. This work has resulted in the identification of compartmentalized viral populations in both the male and female genital tract, suggesting that the tramsitted virus may come from a viral population that is distinct from the blood. The examination of the transmitted virus has shown variation in the patterns of glycosylation that suggest a new strategy for the development of a vaccine to induce neutralizing antibodies. Finally, compartmentalized virus in the CSF has been linked to HIV-associated dementia, including the identification of macrophage-tropic virus selectively evolving in the CNS.