made changes to implementation to get data into temp file