public int compareTo(SearchNode that) {
            if (priority < that.priority) {
                return -1;
            } else if (priority > that.priority) {
                return 1;
            } else {
                if (mdistance < that.mdistance) {
                    return -1;
                } else if (mdistance > that.mdistance) {
                    return 1;
                } else {
                    return 0;
                }
            }
        }