calculate centroid node. needs testing. prints centroid location