Verified all the termination conditions