fix unit moving bug, keep coords formula in one place