updated cmg_ts2cf_loop