add code for implement method in class Class