Solved problem 89 using TDD