Changed definition of for_each for clarity, added for_each_i in it's place.