'lapply.ds' amended!