def rejection sampling