add method to reindex elements