updated Hc and Ts_analysis functions