rebuilt docs and amended exapmles in toTdm.R