Finished problem 1.a