Visual Studio compatible version of Dieter Fox's KLD-sampling algorithm