removed redundant visited updates