adjusted testIsVisited to fit datatype of isVisited