clustering algorithm finished + TODO:analysis