Changed rows of iteration to be dynamic.