Made use of matrix chain calls.