changes the values in index