cachematrix program

code for submission