More minor non-functional changes. This now computes the exit condition, though