added support for writing MM files