added file I/O for editor - need to refactor though