Smoothing.
Added in example code from mostly-working example.

Still needs cleanup.