Adding and updating code for class 2