refactored guess_letter code