Starting writting Hahn subourtine. Unfinished yet