updated ProgrammingAssignment2.R

updated the ProgrammingAssignment2 with the finished functions required
for this assignment