Reformated as an Octave function