Fix function to access prevGuess