With proper comments

This program gives a glimpse of functional programming using R and
proper comments has been included to explain the functions
functionality.