added solution to problm 8