added support for tmp files
code cosmetics
code cosmetics