Added documentation to the functions and got rid of the template
argument in the sparsity function (as it was unnecessary)