Added more of mdd program, a few things cleaned up