Generates main class