got rid of silly sqrt in the phi function