Added function for set replacement