added -+ model matrix function