test reafactored for weighted random test