Final version - cachematrix.R - 17/9/2014