Added sample code for exercises 1 and 2 of Section 6