used array_map instead of foreach