major fixes by Tavrov, added autonumbering appendices