working on karger algo