turn tail call to loop (call stack only 1000 deep in python)