updated code with new calculated radii after my fix to snrate code