Updated f.each method