Made progress on clustering and dynamic tree cut. implemented Order determination