updating code for class 3