Working on implementing the basic systematic phase detection