Updated the set() method