added traverse functionality