replace SimpleMath matrices