Completed Part 1 & 2 of assignement 1 for R Programming