private void update_weights(int index){
		   // update the weight of the currently indexed node
	    tree.elementAt(index).family_weight =  tree.elementAt(index).chance_weight;

	    // First, update self with children's weights
	    // daughters are found at 2(x+1)
	    if( 2*(index+1) < tree.size() )
	    {   // add daughter's weight to family
	        tree.elementAt(index).family_weight += tree.elementAt(2*(index+1)).family_weight;
	    } // else no daughter

	    // sons are found at 2x+1
	    if( 2*index+1 < tree.size() )
	    {   // add son
	        tree.elementAt(index).family_weight += tree.elementAt( 2*index+1 ).family_weight;
	    } // else no son

	    // Second, update parents with self
	    // check for parents, and update them
	    if( index > 0 ) // not the root mother (has parent)
	    {
	        // calculate distance to parent
	        if( (index % 2)>=0 ) { // is a male node
	            update_weights( (index-1)/2 ); // update parent
	        }
	        else { // is a female node
	            update_weights( index/2 - 1 ); // update parent
	        }
	    } // else this is the root mother (no parents)

	}