added option to toggle display and file saving