Merge pull request #4 from borchert/rewrite

Rewrite
add mgs option