Updated demo code for define_method to define class methods