tuple<node,Long> findInM(int[] k, node cnode) throws valid_not_checked, pval_error, make_key_error
	{
		if (cnode.mfilled==0)
			return new tuple<node,Long>(null,(long)0);
		long dist,min;
		int in;
		node minnode,tnode;

		minnode=cnode.getMtable(0);
		min=common.compareKeys(k,minnode.getKey());
		min=(long)Math.abs(min);
		if (min>common.maxN/2) min=common.maxN-min;
		in=0;

		for(int i=1;i<cnode.mfilled;i++)
		{
			tnode=cnode.getMtable(i);
			dist=common.compareKeys(k,tnode.getKey());
			dist=(long)Math.abs(dist);
			if (dist>common.maxN/2) dist=common.maxN-dist;
			if (dist<min)
			{
				min=dist;
				minnode=tnode;
				in=i;
			}
		}

		if (minnode.isValid()==0)
		{
			mtabled(cnode, in);
			return findInM(k, cnode);
		}
		return new tuple<node,Long>(minnode,min);
	}