nick_cmp for node traversal