now correctly generates the main class