minor modification for Matlab Octave comp.