peg calculation