use foreach instead of an array_map