Added support for matrices