int searchq(int alpha,int beta,int ply)
	{
		int next,val;
		move m;
		
		b.pvl[ply]=ply;
		b.qnodes++;
		val=e.e();

		if(val>=beta)
			return beta;
		if(val>alpha)
			alpha=val;

		b.gencaps(ply);
		scoreq(ply);
		sortmoves(ply);
		for(next=b.msi[ply];next<b.msi[ply+1];next++)
		{
			if(b.ss[next]<=0)
				break;
			m=b.ms[next];
			if(b.make(m))
			{
				val=-searchq(-beta,-alpha,ply+1);
				b.unmake();
				if(val>alpha)
				{
			/*		b.pv[ply][ply]=m;
					for(int x=ply+1;x<b.pvl[ply+1];x++)
						b.pv[ply][x]=b.pv[ply+1][x];
					b.pvl[ply]=b.pvl[ply+1];
			*/		if(val>=beta)
						return val;
					alpha=val;
				}
			}
		}
		return alpha;
	}