Implement checking of valid moves