add indice to check and set + reformulation