fixed/completed weighted sum octave codes