finished heuristic functions and added comments