rectified isAdjacent & added isVertex