Cleaned up main()