added functionality to stubs

updated cachematrix.R to have functions conforming to the assignment