R Assignment 2.
apologies for late submission