update index and code