Cleaned up main file