Solutions to cachematrix assignment