functionalized repeated random

pulled into separate function