problem5 solution