adding another optimization for peg