This works

This works on the trial matrices I've tried