add function for class and add main class