Some comments cleaned up.
Flipped the sign on left_fraction (and reordered the dude otherwise).
Docstring correction and other trivial changes.
Generalized 2c to allow different optimise functions.