Updated main loop from sentence computation.