added remove function to remove multiple instances of an object