Well there is a bit of an issue with your for loop


for (int counter=0; counter<=10; counter++)

You are wanting to cycle through the strings you just split up, but you do not have 10 of them...