proper main generation, yeah!