finished modifing the functions for calculating radii