Recognizes valid and invalid moves