Wrote Phevor algorithm.