refactor and added formula for heuristic