def remove(self, index=None, hash=None, keepSorted=True):
        if index is not None:
            clibrebound.reb_remove(byref(self), index, keepSorted)
        if hash is not None:
            hash_types = c_uint32, c_uint, c_ulong
            PY3 = sys.version_info[0] == 3
            if PY3:
                string_types = str,
                int_types = int,
            else:
                string_types = basestring,
                int_types = int, long
            if isinstance(hash, string_types):
                clibrebound.reb_remove_by_hash(byref(self), rebhash(hash), keepSorted)
            elif isinstance(hash, int_types):
                clibrebound.reb_remove_by_hash(byref(self), c_uint32(hash), keepSorted)
            elif isinstance(hash, hash_types):
                clibrebound.reb_remove_by_hash(byref(self), hash, keepSorted)
        if hasattr(self, '_widgets'):
            self._display_heartbeat(pointer(self))
        self.process_messages()