Added extra function for data binning