Completed functions for cachematrix.R