Got heuristic working