Updated R script for computing basic stats and plots