improvements for ptb_to_hist