fixing polarity dependence
More robust root finding. Shouldn't care if polarity is reversed.
Merge branch 'dpph_lockin' into develop