 Experimental design and methods. After 3 weeks of stabilization on daily methadone, outpatients will undergo 25 weeks of EMA. EMA will consist of event-triggered recordings initiated by participants whenever they use heroin or cocaine, or whenever they feel an urge to do so and random-signal-triggered recordings 3 per day. Target quit dates for heroin and cocaine will occur, respectively, on the first and third weeks of EMA. Two days after the cocaine quit date, all participants will begin 12 weeks of intensive voucher-based contingency management to reinforce abstinence from heroin and cocaine. Arm 2: During the same 12 weeks, a within-subjects manipulation will occur: participants will receive simplified versions of the current counselor-assigned homework tasks, and participants will receive a daily reminder via the PDA to complete their homework tasks whether they are standard or simplified versions. The simplified homework tasks and reminders will be given during two separate, counterbalanced, three-week blocks. Arm 3: Starting at week 4 and continuing through week 18 participants will answer enhanced EMA questions regarding stress, mood, location, drug craving and use. Additionally, participants in Arm 3 will carry GPS units to record their locations during these 15 weeks. GPS location will be examined with their drug use, craving and self-reported mood. They will also complete retrospective stress questionnaires at week 3 and then at 4-week intervals throughout the completion of the study: week 7, 11, 15, 19, 23, and 27. After the 12-week homework Arm 2 or enhanced EMA phase Arm 3 ends, participants will have the choice of transferring to a community clinic or undergoing an eight-week taper from methadone. For participants in Arm 2 who choose to detox at Archway, EMA may continue. However, for participants in Arm 3, no EMA or GPS data will be collected during the pre-detox or detox phase weeks 19-28. 