improved SpeedY calculation so that it is inherently faster