changed code for create peg