Completed logic for Hangman game