modified ex 35 to use isdigit()