Added implementation for unit numbers.
Added implementation for numbers up to 99.
Added implementation for numbers up to 999.
Added implementation for numbers up to 3999.
Added check for invalid input.
Cleanup.
Added check for invalid input.
Added check for invalid input.