Add code for problem 3.