Index work

added new elements, code refactor