first run through looping algo