HF as a subroutine