I've updated the first function.  Now if a digit that is not a number is entered, the returned value is false.