moved the location of the file pointer generation