This is my submission for programming assign. 2 for JHU R programming