finished problem 6
finished problem 7