added some assertions
reduced header dependancy