basic computation of hlevels