added debug code for t_i gen