Finished file editing functionality. I will refactor this later.