Adding implementation of index