reorganize tags in PEG file
modular code complete (add references in function params)