Prettied up problem 3.