code rf for using friend model