Added code for setting, needs tests