swap .each with .map to mutate the array objects in the represent array calls