Added ability to save to external files and a data structure for controls