Problem 3 finished