theoretically functional but untested hangman code