simplify matrix logic
v0.1.6