isNaN is confusing to me, so here's a workaround