beginning of in radius function