using arraylist instead..
totals working