filled in cachematrix.r skeleton with functions