cleaned up variable names, fixed an octave error