implemented saa based on number of iterations