updated to allow caching
updated for general radius