simplified & improved node resolution algorithm