completes the exercises 2 and 3, section 5.6