changed array and object creation to allow for an unknown number of data sources in the graph generation