added phases class that does flow/cascade in phases