Add the code for problem 4.