Finishing problem 2.a from homework 2.