add merge sort
merge merge_bucket and histogram into a single function