updateDiffs (Node _ root left right) =
  (Node heightDiff root (updateDiffs left) (updateDiffs right))
    where heightDiff = abs ((height left) - (height rig
treeInsert (Node diff root left right) x
  | x < root  = (Node diff root (treeInsert left x) right)
  | otherwise = (Node diff root left (treeInsert right x))
treeInsert (Node diff root left right) x
  | x < root  = (Node diff root (treeInsert left x) right)
  | otherwise = (Node diff root left (treeInsert right x))