tail call optimization of one function