changed for loops to each loops