rewrote MDM rgp8
revised MDM rgp9