removed use of isnan() function which is not portable across Linux and OSX