Code for class management script