use phaseCount instead of explicit names
use phaseCount instead of phaseNum