added additional functionality for heuristic function v34