Optimized so that nt_items_for_nt is called once for each (nt,j)