Got retryInput() to work. Added more commentaries-