Commit 2 : Analytic Gradient Option Added. NOT TESTED for programming
and other errors.