mainParser mostly done