changed the name to allow calling from octave