Added logic to store closest guess.