Made changes to for loops to support C99 mode