added features to file saving and rules for autosaving file and versions