init of logic to check if a move is valid