added mbkm without replacement + minor clean-up