problems 6 & 7
problem 8