Cleaned up main.