Assignment 2, exercise 1