improved iteration