testing matrix chaining