problem 9 code and tests work-in-progress