TIdying up radius search script