minor modifications to problem 15