Retirement tax questions

Hey Bsch, thanks for the quick response. I'm little confused. In my instance, Y is under $5,000 and Z is exactly $5,000. If we apply that $5,000 rule, shouldn't my total income be X+Z and not X+Y?