Matrix of partial derivatives and some other stuff