Fixing docs for PDF formatting errors
Changed sapply to lapply