inlined new matrix

modified sample