fix hangman bug and add code