bug fix in sendData

The loop in sendData was iterating over "length," and when I ran the code it would hang after the 9th iteration (i=9)

I fixed the bug by changing the loop to iterate over "max_iteration" instead of "length."  Now there are only 7 iterations (128 character data split into 7 substrings of 20 characters max, 0, 1, 2, 3, 4, 5 and 6).  I also had to change the "<" into "<="

-Dan