submitting modified cachematrix.R solution