Add code for problem #7