code: function buildSegments(events) {
  		var segments = [];
  		for (var i=0; i<events.length; i++) {
  			var eventSegments = buildSegmentsForEvent(events[i]);
  			segments.push.apply(segments, eventSegments); // append an array to an array
  		}
  		return segments;
  	}
docs: Generate an array of "segments" for all events.