phase2, added math equation check