if(snapshot_compare(new_state->system_state, state_test->system_state) == 0){
xbt_dynar_remove_at(visited_states, previous_cursor, NULL);
xbt_dynar_insert_at(visited_states, previous_cursor, &new_state);
if(snapshot_compare(new_state->system_state, state_test->system_state) == 0){
xbt_dynar_remove_at(visited_states, previous_cursor, NULL);
xbt_dynar_insert_at(visited_states, previous_cursor, &new_state);