Homework 1 exercise 3 fixed