changing variables and index