How to calculate IRA basis for all prior year contributions?

Hello,

If I contributed the below non deductible amounts to Tradition IRA, the total contributions come to $41,500. Should my basis while submitting the 2023 taxes be 41,500? (as additional information, I moved each contribution to Roth in the respective year)

2017 - 5,500 (did not report 8606)

2018 - 5,500 (did not report 8606)

2019 - 6,000 (did not report 8606)

2020 - 6,000 (reported 8606 but instead of setting basis to 23,000, I set it to 6,000)

2021 - 6,000(reported 8606 but again set the basis to 6,000 wiping all previous non-deductible contributions)

2022 - 6,000 (same as 2021)

2023 - 6,500  Finally, chance to correct the basis. Should this be 41,500?