Made change to double nan instead of long double.