Unifying Octave and Matlab version.

Please, check if it works in Matlab and Octave, I currently cannot.
Also, fixed parameters and now it converges nicely.