Complete cachematrix functions for assignment