implemented RMD.
fixed CWD.