created functions that calculate and cache the inverse of a matrix