Implemented shake detection to undo the last move (no ui)