scala class work