Added code given from book.
This is my starting point.