completed exercise 3 of tutorial section 3.5