Convert for loop to foreach in start method