Amended add method and added new methods for set