solution to problem 37 added