putting method inside class