add to index + minor changes