added inf termination criteria