Added .tgp functionality to main()