add the code for problem 28