added support for NaN