cleaned up pseudocode to make exposition more consistent.
Added brief introduction.
redefined \D to be script D.
cleaned up ending paragraph of section 2.
started 'implementation details' section.