More work on paper.

Rephrased things, updated code snippets to reflect latest code, added motivating example in the intro