Create hpfunction