moved commands outside of main()