simple algorithms developed using TDD