bin calculation over whole data