Fixing tail call elimination
Adding some comments
Merge pull request #11 from einhverfr/reduce_recursion

Prevents deep recursion in the event of connection failure