#3256 Added functionality to check for valid moves.