re-write the settings function