Corrected graphics and updated .R code