second version of problem 34