fixed to run with Octave