writing commented functions to cache matrix and inverse