added parametered matrix stuff