moved main()