Added more debugging. Simpler iteration.