make nnz a class variable instead of a method