preprocessing,binning update

binning method updating. The new codes are in matlab so there is a
unified comparison