added weighted radii and lightly refactored functions relying on difference in xyz