adding bmm clustering and new data structures to support multi-d clustering