modified apply/plyr lesson