corrected version of .each