Using .nnz attribute for count of elements