refactoring near complete code, next XML V5 as of 4pm Monday