another function moved to module
took care of empty sparse matrices