clean up cont_index func