Cleaned up main