Soved problem 8 and 9