added mus documentation and re-using bits from xmi.c, we can removed redundant code later I guess