The phase out works like this:
(1). If Modified Adjusted Gross Income (which is defined in the Roth regs) is less than $160,000 but more than $150,000, subtract $150,000 from your actual Modified Adjusted Gross Income. (2). Divide the difference by the width of the phaseout range ($10,000) to determine the percentage that is not deductible. (3). Multiply the percentage by the maximum contribution ($3,500 or $3,000 depending upon your age). (4) Subtract the result in (3) from the maximum contribution. (5) If the remaining amount is $200 or more, that's your contribution limit. If it's greater than $1 but less than $200, you can contribute $200.
A piece of cake, right?