Added phase calculation for the phase chart.