Improved main()