scala class code