added weighted least squares solver, should be considered experimental