solution to problem 8 added