About 35 percent of the MDMA in the body has been broken down by the liver. Most of these breakdown products are filtered out of the blood in the kidneys and into the primary urine.
The 65 percent of the MDMA molecules that have not been broken down are not eliminated from the body very swiftly. Although they do enter the primary urine (1), most are immediately returned to the bloodstream (2), because MDMA molecules can easily penetrate the cell walls.
Whether the unprocessed MDMA molecules return to the bloodstream or stay in the primary urine and reach the final urine (3) depends on the acidity (pH level) of the urine.
If it is relatively acidic (low pH), then higher levels of MDMA remain in the urine and leave the body. If it is relatively alkaline (high pH), then the MDMA is more likely to return to the blood, and will hence be filtered out of the bloodstream more slowly.