fixed equation bug