added graph generation to visualize for debugging