Removed ordering from median clustering; rearanged partition.cpp code