Change index variables to idx