doctest works for 12 phases.  need to clean up.