Problem 8 and 9 assigment 2