Created the functions for chaching the inverse and compute the inverse