Deductions & credits

Thanks Champ for your help as I have the same situation.

However, this adds another problem. I drew funds from a second account to pay the IRA back from previous withdrawals. Now I have 1099-B showing a significant capital gain.  Can I avoid paying tax on that capital gain since it was all rolled into the IRA account?