updating some codes and creating class tree solution