Minor speedup: pass sentence_id around.