first commit of cache matrix

added comments and completed functions