Non-qualified 529 withdrawal calc for Pennsylvania

My son is filing independently this year for Fed/PA.  We (parents) are the owners of his 529 and made contributions from 2007 thru 2023.  He had 20K of fully qualified withdrawals in 2023. He took a withdrawal of 50K in 2024 which 10K of it was for educational expenses and the rest was unqualified.  Basis/Earnings is approximately 40/60 (and using rounded numbers for simplicity).

 

Seems to me that the remainder of 40K should ALL be taxable income to him in PA but the questions in TT are confusing me and ultimately  indicating that only 15K is taxable.  Is this right??   Should the contributions question be zero - given that we made them, not him?  (Even so, they were all deducted on our PA returns over the years so I would still think the whole 40k would be taxable. )   Appreciate any guidance you could give me here. 

Total 2024 Distributions    50,000AReported on son's return (beneficiary)
Qualified Amount    10,000BReported on 1098-T for son's return
Total Contributions (all before 2024)    40,000CContribs made by PARENTS 
Excess 2024 Contribs             -  Dn/a
2023 Distributions    15,000EDistribs made to beneficiary
Adjusted Basis (C+D-E)    25,000F 
Penna Taxable Amount (A-B-F)    15,000G