writing HF-theory