added traverse method