fixed io.c

tried to use j as a loop variable for two nested loops, haha