fixing the num_teachers_w_nce problem slightly more cleanly