solution to first chapter using TDD