move() now identifies legal moves and swaps tiles