Modified code to only make pegs of the generated shape per level