solution to problem 42 added