fixed a huge memory leak, now runs cleanly. also added various density outputs (simple edge and self-loop)