initial port of pegrb to dart