fcount = u0_end - u1_p_st;
fcount = u0_end - u0_st;
	Cost getOptimalCouple(int u0, int u1) {	    int a,b;	    int u1_p;	    int i, fcount;	    int u0_st, u1_p_st, u0_end, u1_p_end;	    int best_u0, best_u1_p;	    int dist, best_val; 	    Cost cost = new Cost();	    u1_p = clunitDB.getPrevUnit(u1);	    if (u1_p == u0) {		return cost;	    }	    if (u1_p == ClusterUnitDatabase.CLUNIT_NONE ||		    clunitDB.getPhone(u0) !=		    clunitDB.getPhone(u1_p)) {		cost.cost = 10 * getOptimalCoupleFrame(u0, u1);		return cost;	    }	    u0_end = clunitDB.getEnd(u0) - clunitDB.getStart(u0);	    u1_p_end = clunitDB.getEnd(u1_p) - clunitDB.getStart(u1_p);	    u0_st = u0_end / 3;	    u1_p_st = u1_p_end / 3;	    if ((u0_end - u0_st) < (u1_p_end - u1_p_st)) {		fcount = u0_end - u1_p_st;	    } else {		fcount = u1_p_end - u1_p_st;	    }	    best_u0 = u0_end;	    best_u1_p = u1_p_end;	    best_val = Integer.MAX_VALUE;	    for (i = 0; i < fcount; ++i) {		a = clunitDB.getStart(u0)+ u0_st + i;		b = clunitDB.getStart(u1_p) + u1_p_st + i;		dist = getFrameDistance(a, b,		     clunitDB.getJoinWeights(),		     clunitDB.getMcep().getSampleInfo().getNumberOfChannels())		      + Math.abs( clunitDB.getSts().getFrameSize(a) - 			    clunitDB.getSts().getFrameSize(b)) * 			    clunitDB.getContinuityWeight();		if (dist < best_val) {		    best_val = dist;		    best_u0 = u0_st + i;		    best_u1_p = u1_p_st + i;		}	    }	    cost.u0Move = clunitDB.getStart(u0) + best_u0;	    cost.u1Move = clunitDB.getStart(u1_p) + best_u1_p + 1;	    cost.cost = 30000 + best_val;	    return cost;	}