Rewritten main