Fixes issue #25

Add saveSettings function