heritability function rewritten