Completion of problem #2