Fixed some separation of work. Added comments and pseudocode. STILL UNTESTED. Waiting on Pieter's work on xml input to begin integration.