changes R_thr to not use threshold cofficient