commented tg code