updated cachematrix.R with code to hand in for Programming Assignment 2