Solved problems 8 and 9