Retirement tax questions

Ah, thanks. So to clarify,

Let's say that from 2012-2014, I made a total of R valid contributions to my roth IRAs and I made an excess contribution X to my Roth IRA in 2012. X is not part of R, so at the end of 2014, the total amount that I had personally deposited into IRA accounts was (R+X).

I also made S traditional, valid IRA contribution in 2015 which was converted to a Roth IRA in the same year.

This year, 2016, I withdrew the excess contribution, X.

My 8606 part 3 for 2016 will look like (Is this correct?)
line 19 (nonqual'd distributions): X
line 22 (roth basis): R + X
line 24 (basis in conversions): S

Should line 22 be (R) or (R+X)?

I report -X- on line 15a of my 1040. I report the taxable amount  from 8606, line 25 on line 15b.



My total personal contributions to Roth IRA (prior to withdrawal of excess) is (X + R + S). Is it correct that as long as I never withdraw more than that amount, I will never owe any tax on the distribution? Since,
line 23 = X - (X + R) = -R
line 25  (line 23) - S = -R - S < 0

Now, let's say for next year (2017), I'm filling out form 8606 again, and I have made no additional contributions to Roth IRAs or traditional IRAs:
Would line 22 (basis in roth IRA) be -R-, still?