implemented lastMove