Baseline code.
Fleshing out computations.
Added some notes.