Add matrix support