WIP... PEG mostly complete, needs API