Adding reset function via the 'r' key press.