adding phases implementation