Cleaned up main, added various settings.