Updating cachematrix functions

Updating cachematrix functions for programming assignment #2