Added functions and changed vignette.