K-means in 2D, a C implementation