change list to be index
clean code