Add a method to check if a move is valid or not