generate histograms array