Tighten up hangman code and add comments