private void calculateRanges(){		
		//creates ranges in which to put cards
		int[] tmpRack = rack.getCards();
		int lowEnd = 1, highEnd,
			startSlot = 1,
			numSlots = 1;
		
		if (anchorPoints.contains(new Integer(1))) //handle if slot 1 is an anchor, skip it
		{
			lowEnd = tmpRack[0] + 1;
			numSlots--;
			startSlot = 2;
		}
		
		for (int i = 2; i < rack_size; i++){
			highEnd = tmpRack[i-1] - 1; //set highEnd based on the next anchor point
			if (anchorPoints.contains(new Integer(i)))
			{
				myRanges.add(new Range(lowEnd, highEnd, startSlot, numSlots));
				startSlot = i + 1;
				lowEnd = tmpRack[i-1] + 1; //reset lowEnd
				numSlots = 0; //reset numSlots because a range has been created
			}
			else
			{
				numSlots++;
			}
		}
		
		if (anchorPoints.contains(new Integer(rack_size))) //handle if final-slot is an anchor
			highEnd = tmpRack[rack_size-1] - 1;
		else //if final-slot is not an anchor
		{
			highEnd = game.deck.getMaxCard();
			numSlots++;
		}
		myRanges.add(new Range(lowEnd, highEnd, startSlot, numSlots)); //create the final range
		
		
		//remove any ranges with zero slots in them
		ArrayList<Range> toRemove = new ArrayList();
		for (int i = 0; i < myRanges.size(); i++){
			Range tmpRange = (Range) myRanges.get(i);
			if (tmpRange.getNumSlots() == 0)
				toRemove.add(tmpRange);
		}
		myRanges.removeAll(toRemove);
	}