homework for section 8. Not finished. Ran out of time