cleanedup mdatom.c