added some caching in hopes it will speed up the program when calculating radii