implement reindex()