matrix : performance and doc improvements