Fixed Massart method. Checked a lot of results against C++ to confirm accuracy.