computing ht and hs