private void search(int step){
		searchCount++;
		if(searchCount%100000==0){
			System.out.println("Search count:"+searchCount);
		}
		
		int estimate=lowerBound(curPancakes);
		if(step+estimate>curPancakes.size()*2) return;
		
		
		if(isSorted(curPancakes) && step<minSwap){
			minSwap=step;
			finalResults=new ArrayList<Integer>();
			swapResults=new ArrayList<Integer>();
			for(int i:curPancakes){
				finalResults.add(i);
			}
			for(int i=0;i<step;i++){
				swapResults.add(steps.get(i));
			}
			return;
		}
		
		for(int i=1;i<curPancakes.size();i++){
			reverse(curPancakes,i);
			if(steps.size()>step)
				steps.set(step, i);
			else
				steps.add(i);
			search(step+1);
			
			reverse(curPancakes,i);
		}
	}