refactoring threeDigit;