lots of modifications and scritps to compare with octave