added code to the method skeleton provided as part of second assignment

those two methods are used to calculate inverse of matrix and cache it