Add code for problem #4