added the visited boolean

added the visited boolean