Updated sample.states function in rm_pf to decrease computing time