Corrected error: phase2 density was written as phase1 density