improvements to temp file creation
simple merge