revise random sampling