RProgramming assignment2 - cache matrix inverse