simple scanning solution to valid number