2013-12-16 transcoded recusion into to the loop. 10x performance for the automatic solution.