added function to dump variance  per category
experimenting with distance-based weights