employer described in section 457(e)(1)(A), and (C) the amount of voluntary employee contributions by such individual to any qualified retirement plan (as defined in section 4974(c)). Such term shall not include any amount attributable to a payment under subsection (a). (2) Reduction for certain distributions (A) In general The qualified retirement savings contributions determined under paragraph (1) for a taxable year shall be reduced (but not below zero) by the aggregate distributions received by the individual during the testing period from any entity of a type to which contributions under paragraph (1) may be made. (B) Testing period For purposes of subparagraph (A), the testing period, with respect to a taxable year, is the period which includes— (i) such taxable year, (ii) the 2 preceding taxable years, and (iii) the period after such taxable year and before the due date (including extensions) for filing the return of tax for such taxable year. (C) Excepted distributions There shall not be taken into account under subparagraph (A)— (i) any distribution referred to in section 72(p), 401(k)(8), 401(m)(6), 402(g)(2), 404(k), or 408(d)(4), (ii) any distribution to which section 408(d)(3) or 408A(d)(3) applies, and (iii) any portion of a distribution if such portion is transferred or paid in a rollover contribution (as defined in section 402(c), 403(a)(4), 403(b)(8), 408A(e), or 457(e)(16)) to an account or plan to which qualified retirement contributions can be made. (D) Treatment of distributions received by spouse of individual For purposes of determining distributions received by an individual under subparagraph (A) for any taxable year, any distribution received by the spouse of such individual shall be treated as received by such individual if such individual and spouse file a joint return for such taxable year and for the taxable year during which the spouse receives the distribution. (e) Applicable retirement savings vehicle (1) In general The term applicable retirement savings vehicle means— (A) an