Solution for http://codekata.pragprog.com/2007/01/kata_eighteen_t.html