this is how to get rid of recursion
Example 1:

recursion

Example 2:

without recursion

*Examples show fibanacci function and factorial