Retirement tax questions

If you  are a PA resident, your basis is the sum of all your contributions you made into that particular retirement plan through the years less the sum of all your distributions made  from that retirement plan through the years.