renamed isnumber() to isnum() to avoid conflict with <ctype.h>