Completed exercise 3.5 and 3.6