implemented remove() method