cleaning up main.