updating dealingwithgrads and the index to be numbered.