better move handling (not perfect yet though)