Assignment 6 - Problem 3 (except subquestion 3)