The purpose of this study is to (1) compare the effects of buprenorphine and methadone, two types of opioid addiction treatment, on the ability to think and reason among people addicted to opiates, and who are either HIV negative or HIV positive; and (2) investigate whether HIV infection changes the way opioid treatment affects the ability to think and reason. The investigators hypothesize that there will be (1) significant improvement in thinking and reasoning ability after starting buprenorphine treatment compared to methadone treatment, among participants with and without HIV at 2 and 4 months compared to baseline; and (2) HIV positive participants will demonstrate significant improvement in thinking and reasoning ability at 2 and 4 months compared to baseline, but that their thinking and reasoning ability will still be lower than HIV negative participants.