technically broken, but still compiles and runs. Started work to get renaming of the tmp fileworking