added templated traversal code for supporting compressed nodes