analztical and numerical gradient problem search

new implementation of analytical gradient, and finnaly found possible error
error: gradient difference is the factor N e.g: numGrad/N=analyticalGrad