improvement in weighted random element method