changed for loop and fread arguments.