public void positionToNode (Node n)
	// copy the current position to a node.
	{
		n.setaction("AP", "Jago:" + GF.version(), true);
		n.setaction("SZ", "" + S, true);
		n.setaction("GM", "1", true);
		n.setaction("FF", GF.getParameter("puresgf", false)?"4":"1", true);
		n.copyAction(T.top().node(), "GN");
		n.copyAction(T.top().node(), "DT");
		n.copyAction(T.top().node(), "PB");
		n.copyAction(T.top().node(), "BR");
		n.copyAction(T.top().node(), "PW");
		n.copyAction(T.top().node(), "WR");
		n.copyAction(T.top().node(), "PW");
		n.copyAction(T.top().node(), "US");
		n.copyAction(T.top().node(), "CP");
		int i, j;
		for (i = 0; i < S; i++)
		{
			for (j = 0; j < S; j++)
			{
				String field = Field.string(i, j);
				switch (P.color(i, j))
				{
					case 1:
						n.expandaction(new Action("AB", field));
						break;
					case -1:
						n.expandaction(new Action("AW", field));
						break;
				}
				if (P.marker(i, j) > 0)
				{
					switch (P.marker(i, j))
					{
						case Field.SQUARE:
							n.expandaction(new Action("SQ", field));
							break;
						case Field.TRIANGLE:
							n.expandaction(new Action("TR", field));
							break;
						case Field.CIRCLE:
							n.expandaction(new Action("CR", field));
							break;
						default:
							n.expandaction(new MarkAction(field, GF));
					}
				}
				else if (P.haslabel(i, j))
					n
						.expandaction(new Action("LB", field + ":"
							+ P.label(i, j)));
				else if (P.letter(i, j) > 0)
					n.expandaction(new Action("LB", field + ":"
						+ P.letter(i, j)));
			}
		}
	}