final version of class code