storing only indexes inplace of tuple
changed the logic