Added the comments to explain what the functions were doing
Merge branch 'firstbranch' of https://github.com/margsk/ProgrammingAssignment2 into firstbranch