Added snippets to create temp buffer and temp file.