main in a for loop