Changed greedy KDE algorithm to use two-step process.