Move main to mdsdcl.c