Added handling empty clusters during assignment step, more distance function options, and checks for sufficient distinct points before starting