Retirement tax questions

Thanks Opus. Removing the Roth contribution on the federal portion got rid of the penalty and I'm only tax on the gain. One follow-up question. I'm filing in Massachusetts and turbotax is calculating a tax on the full ~$7200 for my state return. Shouldn't I just be taxed on the ~$700 gain? How do get that carry over properly? Thank you for the help.