improve indexed setting
add docstring for set