added feature to select a collection of elements by index or keyword