improve octave script