Replaced recursive algorithm with an iterative + stack. Awesome.