use .each instead of .map for side-effect coding