Added early termination option