refactering calculating delta h min