cachematrix.R edited for ProgrammingAssignment2