move randomized_peg method to peg class