Starting to replace code in get_tgn_data...