Updated remove() method