created getDigit() method