Termination criteria is now checked with isNaN