change doc for indices and remove the unnecessarily tolist() operation