Single matrix return point for cachedMatrix function

simplify code by having a single place where mat is returned.
Initialise the inverse matrix to null