before the big change in main()