potential: replace octave-specific code