Unfortunaly for (i = 0; i <= length; i++) But that's part of the 2nd for function ?
for (i = 0; i <= length; i++)
for