First version of advance mode, it needs a lot more work