IRA for Educational Expenses

Hello, 
I quit my job to go to grad school. In April to make the move and cut ties with my working life I withdrew from my Roth $5,000 to pay off my remaining financed items. Since I should be accruing about $15,000 in educational expenses this year can I avoid the 10% penalty anyway? Or would the funds need to be "earmarked". 

Additional info. My employment income should be about 100k this year, filing jointly w/ 1 child. 10k in long term gains as well.