Retirement tax questions

l surrendered a whole life policy that was issued in 1990 and received the cash value which was less than the amount of premiums paid.  However, over the years I used the dividends on the policy to buy additional insurance, so now I believe my basis has been reduced by the total of dividends that were kept in the policy and not paid out to me.  So, the taxable income on the 1099-R was computed as the surrender value less the basis resulting in a large amount of tax owed on the dividends now that the policy has been surrendered.  Is this a correct description of what happened?  Thanks for your help!