Assignment 2 for Coursera R Programming class (rprog-004)