represent pegs as an algebraic type, for upcoming optimization