cleaning up main()