cachematrix assignment

committed for caching matrix assignemnt