working on substitution index updating