modified index as given in the hw6 description