finish rapmf_c and modify rapmf_r