insert val t@(T tval left right)
    | val > tval = T tval left (insert val right)
    | otherwise = (T tval left right)
insert val t@(T tval left right)
    | val > tval = T tval left (insert val right)
    | otherwise = (T tval left right)
insert val t@(T tval left right)
    | val > tval = T tval left (insert val right)
    | otherwise = (T tval left right)