Added heuristic functions + inline declarations