Feature/use matrix

Doesn't work, but shows the syntax (based off the feature/matrix branch)

Don't bother to merge yet.  I think the main thing is to get the matrix code well tested first, otherwise we can't possibly debug this.