Doctoral code - Octave version