Issues that I see:
1.The for loop looks never ending, dataSize is incremented twice in the loop thus making 'i' forever smaller than dataSize.
2. For loop condition seems off by 1,arrays start at 0
3. You have an additional bracket in the code segment here.
Probably a copy paste error.
4. Total variable scope issues
I'd make sure you check the scope of the dataSize to make sure the method isn't resetting its value every time the method is called. I don't know if the code blocks are supposed to be in the for loop, but since they are, the total isn't being added up correctly because of the scope of the 'total' variables.
In the future, please try to make your code blocks a bit more legible by fixing indents and matching brackets. My first post too. Hello peoples