Programming Assignment 2 from R programming course.