Added HF v2 code