changes to ptb_to_hist