Reducing number of iterations to fit in small memory systems