Fixing y axis calculation bug