modifyNode f (Branch x l r) (b:bs) =
    if b
    then Branch x l (modifyNode f r bs)
    else Branch x (modifyNode f l bs) r
modifyNode f (Branch x l r) (b:bs) =
    if b
    then Branch x l (modifyNode f r bs)
    else Branch x (modifyNode f l bs) r
modifyNode f (Branch x l r) (b:bs) =
    if b
    then Branch x l (modifyNode f r bs)
    else Branch x (modifyNode f l bs) r