add sparsity and density functions