Solution to problem #37 added