added grouping of data and a simpler way to group data in the plot
added grouping of data and a simpler way to group data in the plot