Prototype of heuristic function done