Finished function week3
Merge https://github.com/PeterCrompton/ProgrammingAssignment2
Fouth commit