Finished problem 3