post/pre order traversal working correctly, predicate and action on item functions split into two