diff --git a/HaskellLM.cabal b/HaskellLM.cabal
--- a/HaskellLM.cabal
+++ b/HaskellLM.cabal
@@ -1,5 +1,5 @@
 Name:         HaskellLM
-Version:      0.1.1
+Version:      0.1.2
 License:      GPL
 License-file: LICENSE
 Author:       Kiet Lam
@@ -7,7 +7,7 @@
 Synopsis:     Pure Haskell implementation of the Levenberg-Marquardt algorithm
 Description:  The Levenberg-Marquardt algorithm is a minimization algorithm for functions expressed as a sum of squared errors
               .
-              This can be used for curve-fitting, multidimensional function optimization, or neural networks training
+              This can be used for curve-fitting, multidimensional function minimization, and neural networks training
               .
               Go to <https://github.com/ktklam9/HaskellLM> for example usage (in tests)
 
diff --git a/src/Math/LevenbergMarquardt.hs b/src/Math/LevenbergMarquardt.hs
--- a/src/Math/LevenbergMarquardt.hs
+++ b/src/Math/LevenbergMarquardt.hs
@@ -11,7 +11,7 @@
 -- errors
 --
 -- This can be used for curve-fitting, multidimensional
--- function optimization, or neural networks training
+-- function minimization, and neural networks training
 --
 --
 ----------------------------------------------------
@@ -107,9 +107,9 @@
 
       newErrValue = (sumSquared . func) newParam
   in
-   case abs(newErrValue - errValue) < prec of
+   case norm2(gradients) < prec of
      True -> (newParam, newParam:mat)
      False ->
        case newErrValue > errValue of
-         True  -> lmMinimizeInternal func jacob param prec errValue (lambda * beta) beta (iter - 1) mat
+         True  -> lmMinimizeInternal func jacob param prec errValue (lambda * beta) beta iter mat
          False -> lmMinimizeInternal func jacob newParam prec newErrValue (lambda / beta) beta (iter - 1) (newParam:mat)
