Preliminary get_digit function.