Added regularization to QP