Successful matrix chaining

Got it! The issue was I was using max instead of min. Oops!