Add Octave script for HW5 Q5, Q6, Q7
Fix BUGS introducted by last few commit