Reworked movement calculation