changed method to get the digits from stupid string conversion to modulo operation