public Segment getBestMatchingSegment() {
		boolean found=false;
		Segment bestMatchingSegment = new Segment();
		int max=MinThreshold;
		if(distSegments.size()>0){
			for(Segment seg : distSegments){
				//can't be the segment made this prediction
				if(seg.sequenceSegment==false && seg.segmentActive(false, true)==false){
					int count=0;
					for(Synapse s : seg.synapses){
						if(s.destRegion.columns[s.destCoor[0]][s.destCoor[1]].cells[s.destCoor[2]].pActiveState==true)count++;
					}
					//System.out.print("["+count+","+max+"]");
					if(count>max){
						found=true;
						max=count;
						bestMatchingSegment=seg;
					}
				}
			}	
		}
		if(found==true)return bestMatchingSegment;
		else return null;
	}