Added nodal relationship determination code