re-formatted t_invmod() definition