Does not work correct for digit 0