safety commit
hack hack hack. First attempt.

Still need to read that paper on PEGs