Refactored Peg selection logic to spec.