Added get_first_digit function