inheritance works