define classes correctly