Can any #PHP experts who also know a bit about #AI please have a look at my failing #K-Means implementation? I've included the source code (don't worry, it's well commented and of fairly good quality) and a description of what I think is the problem.