first add cache matrix function