Modified to handle number input