Massive speed improvements for the iteration_status function