public Intersection getClosestNeighbor(ArrayList<Intersection> intersections, Intersection ci)
    {
        intersections.remove(level.startingLocation);
        intersections.remove(level.destination);
        Intersection closestIntersection = intersections.get(0);
        if (intersections.size() > 1)
        {
            for (int i = 1; i < intersections.size(); i++)
            {
                Intersection intersection = intersections.get(i);
                if (calculateDistanceBetweenPoints(ci.x, ci.y, closestIntersection.x, closestIntersection.y) >
                    calculateDistanceBetweenPoints(ci.x, ci.y, intersection.x, intersection.y) &&
                    intersection != level.startingLocation && intersection != level.destination)
                {
                    closestIntersection = intersection;
                }
            }
        }
        return closestIntersection;
    }