added support for a matrix option