Adding sample code.
Homework exercise 1