comparison routine now works for all type of nodes