Update code in cached matrix function