> - if ((i == (nr - 1))) > + if (i == (nr - 1))
Please remove the other set of redundant parentheses as well if you change that line.
> - if ((i == (nr - 1))) > + if (i == (nr - 1))
Please remove the other set of redundant parentheses as well if you change that line.