Fixed logic error of Ax being equal to Ay