added readsettings and writesettings