JBean's submission for R assignment 2