Miscellaneous rscripts