added counter to record number of guesses