cleaned up md_support.c