adding cached matrix functions
fixing missing comma
commenting and fixing bad variable name in set