Finished main function except the code to get the cluster mediods.