public synchronized void setwhite (int i, int j)
	// set a white stone at i,j at the end of the main tree
	{
		if (i < 0 || j < 0 || i >= S || j >= S) return;
		TreeNode p = T.top();
		while (p.haschildren())
			p = p.firstChild();
		Action a = new Action("AW", Field.string(i, j));
		Node n;
		if (p == T.top())
		{
			TreeNode newpos;
			p.addchild(newpos = new TreeNode(1));
			if (Pos == p) Pos = newpos;
			p = newpos;
			p.main(true);
		}
		n = p.node();
		n.expandaction(a);
		if (Pos == p)
		{
			n.addchange(new Change(i, j, P.color(i, j), P.number(i, j)));
			P.color(i, j, -1);
			update(i, j);
			copy();
		}
		MainColor = 1;
	}