Using different variables to control termination