figured out how to save settings to the preferences.  Put in comments on main to explain how to use it.