Refactored the guess checker