Wrote cachematrix functions for Assignment 2