Solved problems 6 & 7