code tweaks to index