public void updateCosts(PathProposal newPath, List<GeoRef> convexHull) {
        //Check if we destroyed the edge of this point
        if (mPath.getInsertionIndex() == newPath.getInsertionIndex()) {
            mPath = null;
            obtainPath(convexHull);
        } else {
            // We haven't destroyed the edge, so we'll check if the new edges are better than the actual

            // First update the insertion index if it's after the insertion point
            if (mPath.getInsertionIndex() > newPath.getInsertionIndex()) {
                updateInsertionIndex();
            }

            // And Check if one of the 2 new edges are better than the actual one
            for (int i = newPath.getInsertionIndex(); i < newPath.getInsertionIndex() + 2; i++) {
                GeoRef p1 = convexHull.get(i),
                        p2 = convexHull.get(i + 1);
                PathProposal auxPath = new PathProposal(i, p, p1, p2);

                if (auxPath.getDifference() < mPath.getDifference()) {
                    mPath = auxPath;
                    this.p1 = p1;
                    this.p2 = p2;
                }
            }
        }
    }