added full 'save to file' feature