Changed dynamic algorithm to iterate versus recursion.
Doesn't lock up a browser.