Added debug output to main()