Updated cachematric.R