Added bit to make sure the node is not visited earlier