public void add(int addressBegin, int addressEnd) {
		Entry<Integer, Integer> entry = ranges.floorEntry(addressBegin);
		if(entry.getValue()<addressBegin){
			entry=ranges.higherEntry(entry.getValue());
			ranges.put(addressBegin, addressEnd);
		}
		else if(entry.getValue()<=addressEnd){
			ranges.put(entry.getKey(), addressEnd);
			entry=ranges.higherEntry(entry.getValue());
		}
		else{
			entry=ranges.higherEntry(entry.getValue());
		}
		//clean up extra ranges
		while(entry!=null&&entry.getValue()<addressEnd){
			ranges.remove(entry.getKey());
			entry=ranges.higherEntry(entry.getKey());
		}
		if(entry!=null&&ranges.floorEntry(addressBegin).getValue()>=entry.getKey()){
			ranges.remove(entry.getKey());
			ranges.put(ranges.floorEntry(addressBegin).getKey(), entry.getValue());
		}
	}