quick'n'dirty movecalculator optimization