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...