added heuristic fn