Use a wrapper and split iterative and recursive into 2 functions