Cached matrix functions added