Method change_index() added for changing index.