public static List<CongressionalDistrict> createDistricts(List<CensusTract> tracts, int numDistricts, MapCoordinate seedCoordinate)
    {
        List<CongressionalDistrict> districts = new ArrayList<CongressionalDistrict>();
        Quicksort sorter = new Quicksort(tracts, seedCoordinate);
        tracts = sorter.getSortedCensusList();

        int statePopulation = calculateStatePopulation(tracts);
        int districtPop = 0;
        int districtCounter = 0;

        // Target population for each district
        int targetPop;
        if (numDistricts > 0)
        	targetPop = statePopulation / numDistricts;
        else 
        	targetPop = statePopulation;
        // Loop for each district:
        // - add a district
        // - add tracts until the target population is reached. As each tract is added to a district,
        // it is removed from the list of tracts
        // - sort the list by distance from the first tract in the new district
        for (districtCounter = 0; districtCounter < numDistricts; districtCounter++)
        {
            districts.add(new CongressionalDistrict());
            while ((districtPop + tracts.get(0).getPopulation()) < targetPop && tracts.size() > 0)
            {
                CensusTract nextTract = tracts.get(0);
                districts.get(districtCounter).addTract(nextTract, districtCounter);
                districtPop += nextTract.getPopulation();
                tracts.remove(0);

            }
            tracts = new Quicksort(tracts, tracts.get(tracts.size()-1).getPosition()).getSortedCensusList();
            districtPop = 0;
        }

        List<MapCoordinate> centers = new ArrayList<MapCoordinate>();
        for (int i=0; i<districts.size(); i++)
    	{
    		centers.add(districts.get(i).getCenter());
    	}
        // Catch any missed tracts and add to the last district
        while (tracts.size() > 0 && numDistricts > 0)
        {
            CensusTract missedTract = tracts.get(0);
            districtPop += missedTract.getPopulation();
            districts.get(nearest(missedTract, centers)).addTract(tracts.get(0), nearest(missedTract, centers));
            tracts.remove(0);
        }

        /*
         * @doc-author Ennis Golaszewskis
         * -_- 
         *
        System.out.println("Starting to fix");
        //districts = fix2(districts);
        for (int i=0; i<districts.size(); i++)
        {
        	System.out.println(districts.get(i).getDistrictPop());
        }
        */
        return districts;
    }