Implemented all primitives except for Matrix+Matrix3D.