made key functions tail recursive
Merge pull request #21 from hsyed/slick1

merged, thanks