State tax filing

This is specifically for Pennsylvania where, I believe, then entire non-qualified portion of the distribution would be taxed, not just the earnings (since PA allows the contributions to be deducted).  Out of the 40K non-qual portion though - basis is approx 16K and earnings are 24K.    For Fed, it makes sense - the 24K (with some additional allocation differences) is taxed & penalized.  But the PA calc doesn't make a lot of sense to me.