double matrix format hack