Added outputs for #3,4. Cleaned up source code. Added work doc.