edited original R file to add my solution for Programming Assignment 2