Different implementation of isNumber