nit: just use leadingDigits[0] instead of capturing the whole expression