added this. to getNumVisited function calls