first node is added and adj list is cared for.