problem 39: done
problem 40: done
problem 41: done