corrected the undefined start value for the phase variable