Added required code for assignment 2 of R Programming class