A submission for the Coursera R Programming class assignment 2