Lots more work on MPF. Wrote gradient descent, all that remains is to write efficient computation of eq 16