valid number

Using finite-state machine
awesome!