Fixed recursion. For my environment's heap space limits, this method currently crashes on the number 25. Previous non-tail recursion crashed at 16, so it's an improvement at least. Will try to further optimize later.