add tail recursion to factorial and fibonacci