Nearest Tag with Visited Tag Check

Working version