nodes = g_list_sort(nodes, sort_node_weight); color->details->chosen_node = node_copy((node_t*)g_list_nth_data(nodes, 0));
node_t *chosen = NULL;  nodes  = g_list_sort(nodes, sort_node_weight); chosen = g_list_nth_data(nodes, 0);  color->details->chosen_node = NULL;
choose_node_from_list(color_t *color){	/*	  1. Sort by weight	  2. color.chosen_node = highest wieghted node 	  3. remove color.chosen_node from all other colors	*/	GListPtr nodes = color->details->candidate_nodes;	nodes = g_list_sort(nodes, sort_node_weight);	color->details->chosen_node =		node_copy((node_t*)g_list_nth_data(nodes, 0));	color->details->pending = FALSE;	if(color->details->chosen_node == NULL) {		crm_err("Could not allocate a node for color %d", color->id);		return FALSE;	}		return TRUE;}