add loop to main