Level 2 d2 samplng heuristic. @Jatin, fix the double free error