Settings function updated