Added test function

Test function with profiling to see how cached matrices actually work.