added better heuristic