Completed homework assignment for Coursera rprog-005 class.