public String toString(){
		ArrayList<Integer> copy = new ArrayList<Integer>(ranges);
		Collections.sort(copy);
		String returnString = "";
		Iterator<Integer> iter;
		iter = copy.iterator();
		int firstNumber = 0;
		int followingNumber = 0;
		boolean ifWasLast = false;
		boolean dontPrintLast = true;
		if(iter.hasNext()){
			followingNumber = iter.next();
		}
		
		while(iter.hasNext()){
			ifWasLast = false;
			firstNumber = followingNumber;
			returnString += firstNumber;
			followingNumber = iter.next();
			if(followingNumber-1 == firstNumber){
				ifWasLast = true;
				returnString+="-";
				while(followingNumber-1 == firstNumber){
					firstNumber = followingNumber;
					if(iter.hasNext()){
						followingNumber = iter.next();
					}
					else {
						dontPrintLast = false;
					}
				}
				returnString+=firstNumber+", ";
				if(!iter.hasNext() && dontPrintLast){
					returnString+=followingNumber;
				}
			}
			else {
				returnString+=", ";
			}
		}
		if(!ifWasLast){
			returnString += followingNumber;
		}
		
		return returnString;
	}