Why the use of the fixed temporary file name, which will cause disaster if more than one instance is running at the same time? Also, you seem to be replacing all tabs with 8 spaces, which is clearly wrong. Did I miss something?