Matrix is almost generated correctly