Exercise 5-13 works. Now to handle incorrect input