using for instead of while loop inside delivery times