completes example 1.3 and exercise 1.5