Fixed up recursion logic to new standards