Finished problem 2