Base code provided by R programming course on Coursera.
Modified by ShikoDoDo on 27/04/2014 to fulfill assignment 2 of this course.
Signed-off-by: ShikoDoDo <msabrybakry@gmail.com>