Removed array_map since server is 5.2. Used foreach instead.