Added ability to save to file and upload file.