edited NAMESPACE, removed unused code from ldm.R