Added 'this' reference to num_instructions field so it's properly updated

Added 'this' reference to num_instructions field so it's properly updated,as before the method was affecting the local method parameter rather than the class field