Better radius calculation function.
Wow, making some real progress here.