First version - decided to store in github...
Tail recursion and pattern matching is nice....