Cleaned up R script and added CodeBook