fixed HF weighting and minor error correction