working code to generate classes.