Improvement

Separate numbers and using switch case for improved performance