Updated heuristic functions from int to double