Finished problem 7, minor changes