CasheMatrix programmed by Jibin Liu 11/15/2014