modified exit_class function to support inner class.
to support inner class
to support inner class
忘れた．．．
use print method instead of print statement