Added the example code for exercise 2