another idea for problem 2
problem 5 complete