replaced iters with visitors and sped up coo matrix