distances and weights now correctly normalized