doctest works for 2 phases.  phases have to be written as [0, 1] and not as range(2).  working on it.