Matrix manipulation library