modify is-matrix and is-multiple