public PERangeList selectPEs(int reqPE){
    	if(getNumPE() < reqPE) {
    		return null;
    	}
    	
   		mergePERanges();
    	PERangeList selected = new PERangeList();
    	
    	for(PERange range : ranges) {
	    	if(range.getNumPE() >= reqPE){
	    		int begin = range.getBegin();
	    		int end = begin + reqPE - 1;
	    		selected.add(new PERange(begin, end));
	    		break;
	    	}
	    	else{
	    		selected.add(range.clone());
	    		reqPE -= range.getNumPE();
	    	}
	    }
	    	
	    selected.sorted = true;
    	return selected;
    }