complete solution to problem 19 added