Adds a final iteration for outputting k iterations.