greedy wait tree working