Updated for R Programming Assignment 2