Updates docs and tidy up main.xc