renamed some variables
updated index
updated index