Convert processGuess to actual event handler