Cleaned up naming the new file a bit, also changing buffers then writing to them out of scope is bad...