Changed isnumber to isdigit (more portable)