fixed fscanf error, reordered data read in