programming assignment 2 for Coursera R course