Can you explain the usage of the temp file here?