add prob 3 solution