code for class 2