begin fill_hist refactor in cython