Added quadratic congruence method