added function to rebin spikes