Added Index expantion routine

grows index values to fill given template